﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace kongjian22
{
    [Designer(typeof(TongJi_EMS._TJ_Basic.TJ_BasicControlDesigner))]
    public partial class duanluqi35kv : TongJi_EMS._TJ_Basic.TJ_BasicControl
    {
        public duanluqi35kv()
        {
            InitializeComponent();
            this.NeedPoint = true;
        }

        private void duanluqi35kv_Paint(object sender, PaintEventArgs e)
        {
            //duanlq = true;
            Pen a = new Pen(Color.Yellow, 1);
            e.Graphics.DrawArc(a, x * 0.5f, y * 0.2f, x, y * 0.2f, 180, 180);
            e.Graphics.DrawArc(a, x * 0.5f, y * 1.6f, x, y * 0.2f, -180, -180);
            e.Graphics.DrawLine(a, x, 0, x, y * 0.2f);
            e.Graphics.DrawLine(a, x, y * 1.8f, x, y * 2f);

            if (duanlq)
            {
                SolidBrush b1 = new SolidBrush(Color.FromArgb(255, 255, 0, 0));
                e.Graphics.DrawLine(a, x, y * 0.4f, x, y * 1.6f);
                e.Graphics.FillRectangle(b1, x * 0.82f, y * 0.3f, x * 0.36f, y * 0.2f);
                e.Graphics.FillRectangle(b1, x * 0.82f, y * 1.5f, x * 0.36f, y * 0.2f);
            }
            else
            {
                SolidBrush b1 = new SolidBrush(Color.FromArgb(255, 0, 255, 0));
                e.Graphics.DrawLine(a, x, y * 1.5f, x, y * 1.1f);
                e.Graphics.DrawLine(a, x, y * 0.5f, x, y * 0.85f);
                e.Graphics.DrawLine(a, x * 0.6f, y * 0.85f, x, y * 1.1f);
                Pen b = new Pen(Color.FromArgb(255, 0, 255, 0), 2);
                e.Graphics.DrawLine(b, x * 0.85f, y * 0.8f, x * 1.15f, y * 0.9f);
                e.Graphics.DrawLine(b, x * 0.85f, y * 0.9f, x * 1.15f, y * 0.8f);
                e.Graphics.FillRectangle(b1, x * 0.82f, y * 0.3f, x * 0.36f, y * 0.2f);
                e.Graphics.FillRectangle(b1, x * 0.82f, y * 1.5f, x * 0.36f, y * 0.2f);
            }


        }

        private void duanluqi35kv_Resize(object sender, EventArgs e)
        {
            this.x = this.Width / 2;
            this.y = this.Height / 2;
            //this.Refresh();

        }

        private void duanluqi35kv_Load(object sender, EventArgs e)
        {
            duanluqi35kv_Resize(sender, e);
        }


    }
}